﻿
#pragma once

#include "base.h"

namespace tools{
    namespace wrapper_details{

    template<class T, size_t N> struct WrapperOperator: public WrapperBase<T, N>
    {
        WrapperOperator(): WrapperBase<T, N>() {}

        T* operator->()            { return this->Resource();  }
        const T* operator->()const { return this->Resource();  }

        operator T&()              { return *this->Resource(); }
        operator const T&()const   { return *this->Resource(); }

        T& operator*()             { return *this->Resource(); }
        const T& operator*()const  { return *this->Resource(); }
    };

    template<size_t N> struct WrapperOperator<void, N>: WrapperBase<void, N>
    {
        WrapperOperator(): WrapperBase<void, N>() {}
    
        void* operator->()            { return this->Resource(); }
        const void* operator->()const { return this->Resource(); }
    };

    }//namespace wrapper_details
}//namespace tools

